import { ContentType } from '@/enums/httpEnum';
import { request } from '@umijs/max';
import { downLoadXlsx } from '@/utils/downloadfile';

// 查询巡检信息列表
export async function getInspectionList(params?: API.Manage.InspectionParams) {
  return request<API.Manage.InspectionPageResult>('/api/inspection/patrolTask/list', {
    method: 'GET',
    headers: { 'Content-Type': ContentType.FORM_URLENCODED },
    params
  });
}
//新增巡检
export function addInspection(params: API.Manage.Inspection) {
  return request<API.Result>('/api/inspection/patrolTask/add', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json;charset=UTF-8',
    },
    data: params,
  });
}

//更新巡检
export function updateInspection(params: API.Manage.Inspection) {
    return request<API.Result>('/api/inspection/patrolTask/update', {
      method: 'POST',
      headers: {
          'Content-Type': 'application/json;charset=UTF-8',
      },
      data: params,
    });
  }

// 删除巡检信息
export async function removeInspection(ids: number[]) {
  return request<API.Result>('/api/inspection/patrolTask/delete', {
    method: 'POST',
    data: ids
  });
}